//
//  DisconveryActicleBottomer.m
//  PigMarket
//
//  Created by 张敬 on 2019/9/2.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "DisconveryActicleBottomer.h"

@interface DisconveryActicleBottomer()

@property (nonatomic, strong) UILabel *tipLab;

@end


@implementation DisconveryActicleBottomer

#pragma mark - lifecycle methods

- (void)setupUI{
    
    [self addSubview:self.commentBg];
    [self addSubview:self.messageLab];
    [self addSubview:self.messageIcon];
    [self addSubview:self.collectionLab];
    [self addSubview:self.collectionIcon];
    [self addSubview:self.likeLab];
    [self addSubview:self.likeIcon];
    [self addSubview:self.tipLab];

    self.line.hidden = NO;
}

- (void)setupLayout{
    
    self.height = 60.f + TJ_SafeAreaBottomHeight;
    
    {
        _commentBg.size = CGSizeMake(180, 36);
        _commentBg.mj_x = 15;
        _commentBg.mj_y = 12;
        
        _commentIcon.size = CGSizeMake(14, 14);
        _commentIcon.mj_x = 15;
        _commentIcon.mj_y = 11;
        
        _commentLab.size = CGSizeMake(_commentBg.width - _commentIcon.right  -20, 36);
        _commentLab.mj_y = 0;
        _commentLab.mj_x = _commentIcon.right + 10;
    }
    
    {
        _messageIcon.size = _collectionIcon.size = _likeIcon.size = CGSizeMake(20, 20);
        _messageIcon.mj_y = _collectionIcon.mj_y = _likeIcon.mj_y = 11;
        _likeIcon.mj_x = KScreenWidth - _likeIcon.width - 28;
        _collectionIcon.mj_x = _likeIcon.left - 36;
        _messageIcon.mj_x = _collectionIcon.left - 36;
    }
    
    {
        _messageLab.size = _collectionLab.size = _likeLab.size = CGSizeMake(40, 20);
        _messageLab.mj_y = _collectionLab.mj_y = _likeLab.mj_y = _collectionIcon.bottom + 3;
        _likeLab.mj_x = KScreenWidth - _likeLab.width - 18;
        _collectionLab.mj_x = _likeLab.left - 36;
        _messageLab.mj_x = _collectionLab.left - 36;
    }
    
    {
        _tipLab.size = CGSizeMake(40, 14);
        _tipLab.mj_y = 3;
        _tipLab.mj_x = _likeIcon.right;
    }
    
    
}


#pragma mark - setter methods
#pragma mark - getter methods

- (UIView *)commentBg{
    
    if (!_commentBg) {
        _commentBg = [UIView makeViewBgColor:UIColorFromRGB(0xF5F5F5) cornerRadius:19];
        [_commentBg addSubview:self.commentIcon];
        [_commentBg addSubview:self.commentLab];
    }
    return _commentBg;
}

- (UILabel *)commentLab{
    
    if (!_commentLab) {
        _commentLab = [UILabel makeLabelWithText:@"期待您的神评论" textColor:UIColorFromRGB(0x999999) font:mFont(13) textAliment:0];
    }
    return _commentLab;
}

- (UIImageView *)commentIcon{
    
    if (!_commentIcon) {
        _commentIcon = [UIImageView makeImageByImageName:@"found_edit" cornerRadius:0];
    }
    return _commentIcon;
}

- (UIImageView *)messageIcon{
    
    if (!_messageIcon) {
        _messageIcon = [UIImageView makeImageByImageName:@"found_comment" cornerRadius:0];
    }
    return _messageIcon;
}

- (UIImageView *)collectionIcon{
    
    if (!_collectionIcon) {
        _collectionIcon = [UIImageView makeImageByImageName:@"like_collection_nomal" cornerRadius:0];
    }
    return _collectionIcon;
}

- (UIImageView *)likeIcon{
    
    if (!_likeIcon) {
        _likeIcon = [UIImageView makeImageByImageName:@"like_nomal" cornerRadius:0];
    }
    return _likeIcon;
}

- (UILabel *)messageLab{
    
    if (!_messageLab) {
        _messageLab = [UILabel makeLabelWithText:@"423" textColor:UIColorFromRGB(0x9A9A9A) font:mFont(12) textAliment:1];
    }
    return _messageLab;
}

- (UILabel *)collectionLab{
    
    if (!_collectionLab) {
        _collectionLab = [UILabel makeLabelWithText:@"收藏" textColor:UIColorFromRGB(0x9A9A9A) font:mFont(12) textAliment:1];
    }
    return _collectionLab;
}


- (UILabel *)likeLab{
    
    if (!_likeLab) {
        _likeLab = [UILabel makeLabelWithText:@"423" textColor:UIColorFromRGB(0x9A9A9A) font:mFont(12) textAliment:1];
    }
    return _likeLab;
}

- (UILabel *)tipLab{
    
    if (!_tipLab) {
        _tipLab = [UILabel makeLabelWithText:@"+1" textColor:UIColorFromRGB(0xFB7802) font:mFont(12) textAliment:0];
    }
    return _tipLab;
}



@end
